package com.yan.demo.demo3;

import java.io.Serial;
import java.io.Serializable;

/**
 * @author taoge
 * @Date 2024/8/8 14:43
 * @Description 生产的商品
 */
public class Product implements Serializable {
    @Serial
    private static final long serialVersionUID = 1443832533476831228L;
    private String name;
    private String colar;

    public Product(String name, String colar) {
        this.name = name;
        this.colar = colar;
    }

    public Product() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getColar() {
        return colar;
    }

    public void setColar(String colar) {
        this.colar = colar;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Product product = (Product) o;

        if (name != null ? !name.equals(product.name) : product.name != null) return false;
        return colar != null ? colar.equals(product.colar) : product.colar == null;
    }

    @Override
    public int hashCode() {
        int result = name != null ? name.hashCode() : 0;
        result = 31 * result + (colar != null ? colar.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "Product{" +
                "name='" + name + '\'' +
                ", colar='" + colar + '\'' +
                '}';
    }
}
